<T:ViewBase x:Class="WPFExcelReport.TQPSTEP"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                   xmlns:QT="clr-namespace:WPFExcelReport;assembly=TQPMERKM"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    Name="TV"
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:Divideby100 x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <WrapPanel  Grid.Row="0" >
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=新步骤}}"></TextBlock>
                    <Button   Grid.Column="1" Click="NewCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button     Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
            </WrapPanel>
            <WrapPanel>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=步骤:}}"></TextBlock>
                    <TextBlock   Grid.Column="1" FontSize="18" Text="{Binding QPSSTEP, Source={StaticResource vwMaster}}" Width="Auto" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=检验项目:}}"></TextBlock>
                    <TextBlock   Grid.Column="1"   Text="{Binding QPSMERKM, Source={StaticResource vwMaster}}" Width="100" />
                    <QT:TSQP12    Grid.Column="2" 
                                  dwQT="{Binding dwQT,ElementName=TV}" 
                                  MERKM="{Binding MERKM,ElementName=TV}" 
                                  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}" />

                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=目标:}}"></TextBlock>
                    <TextBlock  Grid.Column="1"  Text="{Binding QPSNSWERT, Source={StaticResource vwMaster}, Converter={StaticResource d1000}}" Width="60" />

                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=范围:}}"></TextBlock>
                    <ex:NumericBox DecimalPlaces="2" Grid.Column="1"  Text="{Binding QPSNSUG, Source={StaticResource vwMaster}, Converter={StaticResource d1000}}" Width="60" />
                   <ex:NumericBox  DecimalPlaces="2" Grid.Column="2"  Text="{Binding QPSNSOG, Source={StaticResource vwMaster}, Converter={StaticResource d1000}}" Width="60" />
                 </Grid> 
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"  
                >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=QPSSTEP}" Header=" "  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSMERKM}" Header="{Binding Source={Localization:Translate Word=项目}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSNSUG, Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=最小}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSNSOG, Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=最大}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPPPHASE}" Header="{Binding Source={Localization:Translate Word=阶段}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSAENB}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSAEND}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSNEUB}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QPSNEUD}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</T:ViewBase>
